package com.xiaoyao.novel.common;

import com.xiaoyao.novel.util.AutoConfigIP;

/**
 * 常量
 * 
 * @author 旷明爱
 * @date Dec 13, 2012 10:08:35 AM
 */
public class Constant {
	//子目录绑定有问题,只能用自己的域名访问
//	public static String IP = "http://edaz.vxg205.10000net.cn"; 
//	public static String IP = "http://127.0.0.1";
	public static String PORT = "";
	public static String WEBROOT = "";

	// public static final String LOCAL_IP = "http://127.0.0.1";
	// public static String LOCAL_PORT = ":8080";
	// public static final String LOCAL_WEBROOT = "/novel";

	public static boolean DEBUG = false;
	public static final String CHARSET = "UTF-8";
	public static final String ADMIN_SESSION_KEY = "loginAdmin";

	// 时间常量
	public static final long MIN = 1000L * 60  ;
	public static final long HOUR = MIN * 60;
	public static final long DAY = 24 * HOUR;
	public static final long TEN_DAY = 10 * DAY;

	static {
		String localIP = AutoConfigIP.getLocalIP();
		if (localIP.startsWith("192.168.")) {
			DEBUG = true;
		}

		if (DEBUG) {
//			IP = "http://127.0.0.1";
			PORT = ":8080";
			WEBROOT = "/novel";
		}
	}

}
